import React, { useState } from 'react'
import { Button, CountDown } from 'react-vant';
import Child from './componets/Child';
function App() {
  // 5.使用useState存储状态
  const [count, setcount] = useState(0)
  const add = () => {
    setcount(count + 1)
  }
  return (
    <div>
      <Child></Child>



      {/* 6.状态发生改变的时候， 试图跟着改变 */}
      <CountDown style={{ color: 'red', fontSize: '20px', fontWeight: 'bold', backgroundColor: 'pink' }} time={30 * 60 * 60 * 1000} format="DD 天 HH 时 mm 分 ss 秒" />
      {/* 7.每秒钟改变一次 */}
      {/* 8.完成倒计时效果 */}
      <h2>计数器:{count}</h2>
      <Button onClick={add}>+</Button>
    </div>
  )
}

export default App